<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\User\UserController;
use App\Http\Controllers\Guard\User\FlyOrderController;
use App\Http\Controllers\Guard\Order\OrderController;
use App\Http\Controllers\Guard\Goods\GoodsController;
use App\Http\Controllers\Guard\Setting\SettingController;


/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/getToken',[LoginController::class,'getToken']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::post('/upload',[LoginController::class,'upload'])->name('as','api/upload');
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);
Route::get('/getArea',[LoginController::class,'getArea']);
Route::get('/download',[LoginController::class,'download']);
Route::post('/importFile',[LoginController::class,'importFile']);

//商品管理
Route::group(['prefix'=>'goods'],function(Router $router){
    $router->get('/lst',[GoodsController::class,'lst']);
    $router->post('/add',[GoodsController::class,'add']);
    $router->get('/del',[GoodsController::class,'del']);
    $router->post('/change',[GoodsController::class,'change']);
    $router->get('/detail',[GoodsController::class,'detail']);
});
//兑换订单
Route::group(['prefix'=>'order'],function(Router $router){
    $router->get('/lst',[OrderController::class,'lst']);
    $router->post('/add',[OrderController::class,'add']);
    $router->get('/del',[OrderController::class,'del']);
    $router->get('/change',[OrderController::class,'change']);
    $router->get('/detail',[OrderController::class,'detail']);
});
//用户管理
Route::group(['prefix'=>'user'],function(Router $router){
    $router->get('/lst',[UserController::class,'lst']);
    $router->post('/add',[UserController::class,'add']);
    $router->get('/del',[UserController::class,'del']);
    $router->post('/change',[UserController::class,'change']);
    $router->get('/detail',[UserController::class,'detail']);
    $router->get('/pointlog',[UserController::class,'pointlog']);
});

//自助积分
Route::group(['prefix'=>'flyOrder'],function(Router $router){
    $router->get('/lst',[FlyOrderController::class,'lst']);
    $router->post('/add',[FlyOrderController::class,'add']);
    $router->get('/del',[FlyOrderController::class,'del']);
    $router->post('/change',[FlyOrderController::class,'change']);
    $router->get('/detail',[FlyOrderController::class,'detail']);
    $router->get('/check',[FlyOrderController::class,'check']);
});


//商品管理
Route::group(['prefix'=>'setting'],function(Router $router){
    $router->get('/lst',[SettingController::class,'lst']);
    $router->post('/add',[SettingController::class,'add']);
});

//rbac权限管理
Route::group(['prefix'=>'rbac'],function(Router $router){

    $router->get('/getGuardUser',[LoginController::class,'getGuardUser']);
    $router->get('/loginLog',[LoginController::class,'loginLog']);

    $router->match(['get','post'],'/permission/lst',[PermissionController::class,'lst']);
    $router->match(['get','post'],'/permission/add',[PermissionController::class,'add']);
    $router->get('/permission/detail',[PermissionController::class,'detail']);
    $router->get('/permission/del',[PermissionController::class,'del']);

    $router->get('/role/lst',[RoleController::class,'lst']);
    $router->match(['get','post'],'/role/add',[RoleController::class,'add']);
    $router->get('/role/del',[RoleController::class,'del']);
    $router->get('/role/detail',[RoleController::class,'detail']);

    $router->get('/guardUser/getPermission',[GuardUserController::class,'getPermission']);
    $router->get('/guardUser/lst',[GuardUserController::class,'lst']);
    $router->match(['get','post'],'/guardUser/add',[GuardUserController::class,'add']);
    $router->get('/guardUser/detail',[GuardUserController::class,'detail']);
    $router->get('/guardUser/getUserByToken',[GuardUserController::class,'getUserByToken']);
    $router->get('/guardUser/del',[GuardUserController::class,'del']);
    $router->get('/guardUser/change',[GuardUserController::class,'change']);
    $router->post('/guardUser/resetPassword',[GuardUserController::class,'resetPassword']);
    $router->post('/guardUser/coverPassword',[GuardUserController::class,'coverPassword']);
});





